﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.talent.entity;

import javax.validation.constraints.NotNull;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.hh.bss.base.BaseEntity;
import com.hh.bss.util.DateConvertUtils;



public class CvCertificate extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "CvCertificate";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_CV_ID = "cvId";
	public static final String ALIAS_BEGIN_D = "beginD";
	public static final String ALIAS_INSTITUTION = "institution";
	public static final String ALIAS_INSTITUTION_EN = "institutionEn";
	public static final String ALIAS_PAPERS = "papers";
	public static final String ALIAS_PAPERS_EN = "papersEn";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	public static final String ALIAS_IS_ENG = "isEng";
	//date formats
	public static final String FORMAT_BEGIN_D = SHORT_DATE_FORMAT;
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.lang.Integer cvId;
	@NotNull 
	private java.util.Date beginD;
	@NotBlank @Length(max=200)
	private java.lang.String institution;
	@Length(max=200)
	private java.lang.String institutionEn;
	@Length(max=200)
	private java.lang.String papers;
	@Length(max=200)
	private java.lang.String papersEn;
	@Length(max=50)
	private java.lang.String creator;
	private java.util.Date createDt;
	@Length(max=50)
	private java.lang.String modifier;
	private java.util.Date modifiedDt;
	//columns END
	private java.lang.String isEng="0";

	public CvCertificate(){
		
	}

	public CvCertificate(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setCvId(java.lang.Integer value) {
		this.cvId = value;
	}
	
	public java.lang.Integer getCvId() {
		return this.cvId;
	}
	public String getBeginDString() {
		return DateConvertUtils.format(getBeginD(), FORMAT_BEGIN_D);
	}
	public String getBeginSDString() {
		return DateConvertUtils.format(getBeginD(), SHORT_DATE_FORMAT);
	}
	public void setBeginDString(String value) {
		setBeginD(DateConvertUtils.parse(value, FORMAT_BEGIN_D,java.util.Date.class));
	}
	
	public void setBeginD(java.util.Date value) {
		this.beginD = value;
	}
	
	public java.util.Date getBeginD() {
		return this.beginD;
	}
	public void setInstitution(java.lang.String value) {
		this.institution = value;
	}
	
	public java.lang.String getInstitution() {
		return this.institution;
	}
	public void setInstitutionEn(java.lang.String value) {
		this.institutionEn = value;
	}
	
	public java.lang.String getInstitutionEn() {
		return this.institutionEn;
	}
	public void setPapers(java.lang.String value) {
		this.papers = value;
	}
	
	public java.lang.String getPapers() {
		return this.papers;
	}
	public void setPapersEn(java.lang.String value) {
		this.papersEn = value;
	}
	
	public java.lang.String getPapersEn() {
		return this.papersEn;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}
	
	public java.lang.String getModifier() {
		return this.modifier;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}
	
	

	public java.lang.String getIsEng() {
		return isEng;
	}

	public void setIsEng(java.lang.String value) {
		this.isEng = value;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("CvId",getCvId())
			.append("BeginD",getBeginD())
			.append("Institution",getInstitution())
			.append("InstitutionEn",getInstitutionEn())
			.append("Papers",getPapers())
			.append("PapersEn",getPapersEn())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.append("Modifier",getModifier())
			.append("ModifiedDt",getModifiedDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CvCertificate == false) return false;
		if(this == obj) return true;
		CvCertificate other = (CvCertificate)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

